from selenium.webdriver.common.by import By

from framework.basePage import BasePage
from page.highSearchPage import HighSearchPage

'''
	PO:网站首页
'''

class IndexPage(BasePage):
	def __init__(self,driver = None):
		super().__init__(driver)
		self.driver.get("http://ceshiren.com")
		self.driver.maximize_window()

	# 返回高级搜索页面
	def createHighSearchPage(self):
		self.click(By.CSS_SELECTOR,"li[class='header-dropdown-toggle search-dropdown']>a[id='search-button']>svg[class='fa d-icon d-icon-search svg-icon svg-node']")
		self.click(By.CSS_SELECTOR,"section[id='main']>div[class='ember-view']>div[class='d-header-wrap ember-view']>header[class='d-header clearfix']>div[class='wrap']>div[class='contents clearfix']>div[role='navigation']>div[class='search-menu']>div[class='menu-panel drop-down']>div[class='panel-body']>div[class='panel-body-contents']>div[class='search-input']>div[class='searching']>a[class='widget-link show-advanced-search']>svg[class='fa d-icon d-icon-sliders-h svg-icon svg-node']")
		return HighSearchPage(self.driver)

	#返回portal主页
	def returnPortalPage(self):
		self.click(By.CSS_SELECTOR,"[class='logo-big'][id='site-logo']")
		return self

	# 返回开源项目页面
	def createOpenProjectPage(self):
		...

	# 返回学习笔记页面
	def createStudyNotePage(self):
		...